package com.px.controller;


import com.px.dto.Result;
import com.px.dto.ResultUtils;
import com.px.service.FastDFSClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.Map;

@RestController
public class FastDfsController {
    @Resource
    private FastDFSClient fastDFSClient;

    //文件上传只能使用post
    @PostMapping("/api/uploadFile")
    public Result uploadFile(MultipartFile myImage)throws Exception{
        Map resMap = fastDFSClient.uploadFile2(myImage);
        return ResultUtils.returnDataSuccess(resMap);
    }

}
